package com.easyaop.test.core.pointcut;

import com.easyaop.test.core.listener.EventListener;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

/**
 * @author lipan
 * @since 2025-01-21
 */
public abstract class AbstractPointcutEventListener extends Pointcut implements Iterable<EventListener> {
    protected List<EventListener> eventListeners = new LinkedList<>();

    public AbstractPointcutEventListener() {
    }

    public void addEventListener(EventListener eventListener) {
        eventListeners.add(eventListener);
    }

    @Override
    public Iterator<EventListener> iterator() {
        return eventListeners.iterator();
    }
}
